<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style type="text/css">
        *{
            margin: 0 auto;
            padding: 0 auto;
        }
        div{
            margin: 0 auto;
            text-align: center;
        }
    </style>
</head>
<body>
<div>
    <canvas width="600" height="600" id="can">您的浏览器版本太低，不支持画布，请升级您的浏览器</canvas>
</div>
<script type="text/javascript">
    var box=document.getElementById("can");
    var pen=box.getContext("2d");
    pen.beginPath();
    pen.strokeStyle="green";
    pen.fillStyle="green";
    pen.fill();
    pen.fillRect(100,100,400,100);
    pen.clearRect(110,125,200,50);
    pen.stroke();
</script>
</body>
</html>